import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
   state:{
     idList:[],
     nextId:''
   },
   mutations:{
     ALLID(state,ids){
       state.idList = ids
     },
     NEXTID(state,ids){
       for(let i=0; i<state.idList.length; i++){
         if(state.idList[i].id==ids){
           state.nextId = state.idList[i+1].id
         }
       }
     }
   }
})

export default store